﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MvcDemo.Controllers
{
    public class AjaxController : Controller
    {
        // GET: Ajax
        public ActionResult Index()
        {
            ViewBag.Url = Url.Content("~/Views/Shared/test.html");
            return View();
        }


        [OutputCache(Duration =10)]
        public ActionResult GetTime()
        {
            return Content(DateTime.Now.ToString());
        }



        public JsonResult GetTestData()
        {
            return Json(
                new { msg = "Datetime from server：" + DateTime.Now.ToString("HH:mm:ss") }
            );
        }


    }
}